﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace V5_Apps.Core {
    public class AppHelper {
        private static readonly AppHelper m_Instance = new AppHelper();
        public static AppHelper Instance {
            get { return m_Instance; }
        }

        /// <summary>
        /// 获取插件所在的目录 GetAppPath("EBook")
        /// </summary>
        public string GetAppPath(string pluginDir) {
            string configFile = AppDomain.CurrentDomain.BaseDirectory + "Plugins.config";
            if (File.Exists(configFile)) {
                return AppDomain.CurrentDomain.BaseDirectory;
            }
            return AppDomain.CurrentDomain.BaseDirectory + "/Plugins/" + pluginDir + "/";
        }
    }
}
